#include "junix.h"

#include <boost/lambda/lambda.hpp>
#include <boost/lambda/bind.hpp>

int main(int argc, char **argv)
{
	srand(time(0));
	std::vector<int> v(20);

	using namespace boost::lambda;
	std::for_each(v.begin(), v.end(),
			_1=bind(rand) % 20);

	std::sort(v.begin(), v.end());

	std::for_each(v.begin(),v.end(),
			std::cout<<_1<<" ");

	std::cout<<std::endl;

	std::generate(v.begin(),v.end(),
			bind(std::modulus<int>(), bind(rand), 20));

	std::copy(v.begin(), v.end(),
			std::ostream_iterator<int>(std::cout, " "));

	std::cout<<std::endl;
}
